<template>
  <div class="tobBtoC">
    <div class="contentTopTitle">
      <div class="fl">
        <div class="title">详情</div>
      </div>
      <div class="fr">
        <el-button @click="$router.go(-1)"
                   size="mini">返回</el-button>
      </div>
    </div>
    <div class="table-content clearfix">
      <div class="content">
        <div class="tableBox">
          <el-table id="table1"
                    ref="table"
                    size="mini"
                    :header-cell-style="{ background: '#eef1f6' }"
                    :data="tableData"
                    v-loading="tableLoading"
                    style="width: 100%"
                    border>
            <el-table-column prop="areaType"
                             label="区县分类"/>
            <el-table-column prop="c3Id"
                             label="地址编码"/>
            <el-table-column prop="c3Name"
                             label="地市名称"/>
            <el-table-column prop="c4Name"
                             label="县(市)分公司/分局" />
            <el-table-column prop="className"
                             label="指标大类" />
            <el-table-column prop="indexCode"
                             label="指标编码" />
            <el-table-column prop="indexName"
                             label="指标名称" />
            <el-table-column prop="indexValue"
                             label="指标值" />
          </el-table>

        </div>
      </div>
    </div>
  </div>
</template>

<script>
import prefixAPI from '@/api/prefixAPI'
import { getCookie } from '@/common/js/cookie'
import { getSessionStorage } from '@/common/js/storage'
import { $budgetAPI } from '@/api'
export default {
  name: 'indexDetail',
  data() {
    return {
      form: {
        time: this.moment().format('yyyy'),
      },
      tableData: [],
      tableLoading: false,
      titles: [],
    }
  },
  mounted() {
    let that = this

    that.accountInfo = JSON.parse(getSessionStorage('accountInfo'))
    that.form.areaId = that.accountInfo.areaId
    // that.form.time = that.moment().format("YYYYMM");
    that.getData()
  },
  methods: {
    getData() {
      var that = this
      that.tableLoading = true
      $budgetAPI.ScaleYsIndexHistoryRecordList(
        {
          flowId: that.$route.query.id,
          // acctYear: that.form.time,
        },
        (res) => {
          if (res && res.code == 0) {
            that.tableData = res.content
            console.log(res);
          }
          that.tableLoading = false
        }
      )
    },
  },
}
</script>

<style lang="scss" scoped>
.remark {
  padding-top: 5px;
  text-align: left;
  .attention {
    font-weight: bold;
  }
}
.table-content {
  .table-header {
    display: flex;
    justify-content: space-between;
    .table-title {
      font-size: 14px;
      font-weight: bold;
      height: 30px;
      line-height: 30px;
      span {
        display: inline-block;
        width: 5px;
        height: 5px;
        background-color: #418ee9;
        border-radius: 1000%;
        overflow: hidden;
        margin-right: 10px;
        margin-bottom: 3px;
      }
    }
  }
  .content {
    margin-top: 15px;
  }
}
</style>
